home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
(A)G
/
(A)G1.ADF
/
ABasic_games
/
Blackjack.bas
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
2008-10-31
|
27KB
|
996 lines
' Amiga Blackjack by Larry Teter
DEFINT A-Z
RANDOMIZE TIMER
OPTION BASE 0
DIM card(662),Values(18,12),BigSuit(140,3),LittleSuit(24,3),Deck(51,1)
DIM DeckTitle(66),YourTitle(82),MyTitle(66),StandTitle(50),StopSign(662)
DIM CardBack(662),CardXLoc(5),VoiceParm(8),Timbre(255)
GOSUB InitializeVariables
GOSUB Logo
GOSUB ReadGraphics
Pass=1
GOSUB ShuffleDeck
Pass=2
GOSUB InitializeMenu
GOSUB SetUpWindow
GOSUB MessageSetUp
ON MENU GOSUB MenuHandler
MENU ON
SAY TRANSLATE$("Let's get this show on the road!"),VoiceParm
Replay:
Turn=1
GOSUB AnteUp
GOSUB DealNewGame
GOSUB TestForBlackjack
WHILE Turn=1
WaitForMouse:
IF MOUSE(0)=0 THEN WaitForMouse
WHILE MOUSE(0)<>0
WEND
X=MOUSE(1)
Y=MOUSE(2)
IF X>5 AND X<115 AND Y>2 AND Y<71 THEN
GOSUB HitPlayer
ELSEIF X>5 AND X<115 AND Y>81 AND Y<150 THEN
IF YourHand2<22 THEN
YourHand1=YourHand2
ELSE
YourHand2=YourHand1
END IF
GOSUB UpdateHandTotal
Turn=2
ELSE
GOTO WaitForMouse
END IF
IF YourCardCount=5 AND YourHand1<22 THEN
GOSUB FiveCardCharlieYou
Turn=3
END IF
WEND
IF BJ$<>"YES" THEN GOSUB FlipDownCard
WHILE Turn=2
IF MyHand2<22 THEN
MyTotal=MyHand2
ELSE
MyTotal=MyHand1
END IF
IF MyCardCount=5 AND MyHand1<22 THEN
GOSUB FiveCardCharlieMe
Turn=3
ELSEIF MyTotal>16 THEN
IF MyTotal>YourHand2 THEN
Code=MyTotal
GOSUB Decode
Message$="My "+Text$
Message2$="My "+Text2$
Code=YourHand2
GOSUB Decode
Message$=Message$+" beats your "+Text$+" -- I win"
Message2$=Message2$+" beats your "+Text2$+" -- I win"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$(Message2$),VoiceParm
Turn=3
YourTotal&=YourTotal&-Bet
GOSUB UpdateScore
ELSEIF MyTotal=YourHand2 THEN
Message$="It's a push -- I win"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$("It's a push. I win."),VoiceParm
Turn=3
YourTotal&=YourTotal&-Bet
GOSUB UpdateScore
ELSE
Code=YourHand2
GOSUB Decode
Message$="Your "+Text$
Message2$="Your "+Text2$
Code=MyTotal
GOSUB Decode
Message$=Message$+" beats my "+Text$+" -- You win"
Message2$=Message2$+" beats my "+Text2$+" -- You win"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$(Message2$),VoiceParm
Turn=3
YourTotal&=YourTotal&+Bet
GOSUB UpdateScore
END IF
ELSE
Code=MyTotal
GOSUB Decode
Message$="I'm taking a hit on "+Text$
Message2$="I'm taking a hit on "+Text2$
GOSUB PrintIt
IF Speech$="ON" THEN
SAY TRANSLATE$(Message2$),VoiceParm
ELSE
FOR I=1 TO 2000
NEXT I
END IF
GOSUB HitDealer
END IF
WEND
GOSUB WaitForTapOnDeck
GOSUB NewHand
GOSUB UpdateHandTotal
GOSUB UpdateBet
GOSUB EraseCardWindows
GOTO Replay
Decode:
IF Code=4 THEN
Text$="four"
Text2$="four"
ELSEIF Code=5 THEN
Text$="five"
Text2$="five"
ELSEIF Code=6 THEN
Text$="six"
Text2$="six"
ELSEIF Code=7 THEN
Text$="seven"
Text2$="seven"
ELSEIF Code=8 THEN
Text$="eight"
Text2$="eight"
ELSEIF Code=9 THEN
Text$="nine"
Text2$="nine"
ELSEIF Code=10 THEN
Text$="ten"
Text2$="ten"
ELSEIF Code=11 THEN
Text$="eleven"
Text2$="elehven"
ELSEIF Code=12 THEN
Text$="twelve"
Text2$="twelve"
ELSEIF Code=13 THEN
Text$="thirteen"
Text2$="thirrrrtttteeeene"
ELSEIF Code=14 THEN
Text$="fourteen"
Text2$="fourrrrtttteeeene"
ELSEIF Code=15 THEN
Text$="fifteen"
Text2$="fifteeeene"
ELSEIF Code=16 THEN
Text$="sixteen"
Text2$="sixteeeene"
ELSEIF Code=17 THEN
Text$="seventeen"
Text2$="seventeeeene"
ELSEIF Code=18 THEN
Text$="eighteen"
Text2$="eighghghtttteeeene"
ELSEIF Code=19 THEN
Text$="nineteen"
Text2$="nyyyynteeeene"
ELSEIF Code=20 THEN
Text$="twenty"
Text2$="twenty"
ELSEIF Code=21 THEN
Text$="twenty-one"
Text2$="twenty-one"
END IF
RETURN
HitPlayer:
CardX=CardXLoc(YourCardCount+1)
CardY=13
Points=-(Deck(NextCard,1)+1)+15
GOSUB AddYourPoints
GOSUB DisplayCard
YourCardCount=YourCardCount+1
GOSUB UpdateHandTotal
IF YourHand1>21 THEN
Message$="You're busted!"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$("You are busted"),VoiceParm
Turn=3
YourTotal&=YourTotal&-Bet
GOSUB UpdateScore
END IF
RETURN
HitDealer:
CardX=CardXLoc(MyCardCount+1)
CardY=92
Points=-(Deck(NextCard,1)+1)+15
GOSUB AddMyPoints
GOSUB DisplayCard
MyCardCount=MyCardCount+1
IF MyHand1>21 THEN
Message$="I'm busted!"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$("I am busted"),VoiceParm
Turn=3
YourTotal&=YourTotal&+Bet
GOSUB UpdateScore
END IF
RETURN
FiveCardCharlieYou:
Message$="You win with a five card Charlie"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$("You win with a five card Charley"),VoiceParm
YourTotal&=YourTotal&+Bet
GOSUB UpdateScore
RETURN
FiveCardCharlieMe:
Message$="I win with a five card Charlie"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$("I win with a five card Charley"),VoiceParm
YourTotal&=YourTotal&-Bet
GOSUB UpdateScore
RETURN
WaitForTapOnDeck:
IF MOUSE(0)=0 THEN WaitForTapOnDeck
WHILE MOUSE(0)<>0
WEND
X=MOUSE(1)
Y=MOUSE(2)
IF X<6 OR X>114 OR Y<3 OR Y>70 THEN WaitForTapOnDeck
RETURN
TestForBlackjack:
BJ$="NO"
IF YourHand2=21 AND MyHand2<>21 THEN
YourHand1=YourHand2
GOSUB UpdateHandTotal
Message$="You get double your bet for blackjack!"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$(Message$),VoiceParm
Turn=3
YourTotal&=YourTotal&+2*Bet
ELSEIF YourHand2<>21 AND MyHand2=21 THEN
GOSUB FlipDownCard
Message$="I have Blackjack -- You lose!"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$(Message$),VoiceParm
Turn=3
YourTotal&=YourTotal&-Bet
BJ$="YES"
ELSEIF YourHand2=21 AND MyHand2=21 THEN
YourHand1=YourHand2
GOSUB UpdateHandTotal
GOSUB FlipDownCard
Message$="We both have blackjack -- Since it's a push I win!"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$(Message$),VoiceParm
Turn=3
YourTotal&=YourTotal&-Bet
BJ$="YES"
END IF
GOSUB UpdateScore
RETURN
MenuHandler:
MENU OFF
MenuColumn=MENU(0)
MenuItem=MENU(1)
IF MenuColumn=1 THEN
IF MenuItem=1 THEN
IF Speech$="ON" THEN
SAY TRANSLATE$("I will shut upp"),VoiceParm
Speech$="OFF"
MENU 1,1,1," Turn Speech On "
ELSE
SAY TRANSLATE$("I am back"),VoiceParm
Speech$="ON"
MENU 1,1,1," Turn Speech Off "
END IF
ELSEIF MenuItem=2 THEN
IF Sounds$="ON" THEN
IF Speech$="ON" THEN SAY TRANSLATE$("I have shut off the sound ahfects"),VoiceParm
Sounds$="OFF"
MENU 1,2,1," Turn Sound Effects On "
ELSE
IF Speech$="ON" THEN SAY TRANSLATE$("I have turned the sound ahfects back on"),VoiceParm
Sounds$="ON"
MENU 1,2,1," Turn Sound Effects Off "
END IF
ELSEIF MenuItem=3 THEN
Text$="start over with one hundred dollars."
GOSUB AreYouSure
IF Response$="YES" THEN
YourTotal&=100
GOSUB UpdateScore
GOSUB NewHand
GOSUB UpdateBet
GOSUB UpdateHandTotal
GOSUB EraseCardWindows
MENU ON
GOTO Replay
END IF
ELSEIF MenuItem=4 THEN
Text$="quit the program."
GOSUB AreYouSure
IF Response$="YES" THEN SYSTEM
END IF
ELSE
IF MenuItem=1 THEN
GOSUB Instructions
ELSE
GOSUB PlugAuthor
END IF
END IF
MENU ON
RETURN
PlugAuthor:
WINDOW 3," Author's Plug",(80,50)-(550,152),0
COLOR 2,1
CLS
PRINT
PRINT " This Amiga blackjack game was conceived and written"
PRINT " by L. C. Teter, a gamester who lives in Harvey"
PRINT " Louisiana."
PRINT
PRINT " This program has been placed in the public domain"
PRINT " for the enjoyment of anyone who wants to play with"
PRINT " it. Any commercial use of this program is strictly"
PRINT " a no-no."
PRINT
PRINT
COLOR 3,1
PRINT " -- Press left mouse button to continue --";
WHILE MOUSE(0)=0
WEND
WHILE MOUSE(0)<>0
WEND
WINDOW CLOSE 3
RETURN
Instructions:
WINDOW 3," It's Like This . . .",(0,0)-(631,186),0
COLOR 2,1
CLS
PRINT
PRINT " This is a straightforward blackjack game in which you pit yourself against"
PRINT " the Amiga which plays the role of the dealer. The object of the game is to"
PRINT " make as much money as possible by coming closer to 21, without going over,"
PRINT " than the dealer. Face cards count for ten points, aces may be either one or"
PRINT " eleven points, and all other cards have a value equal to the number on the"
PRINT " card."
PRINT
PRINT " Before each hand you must place a bet. Any dollar amount from one to one"
PRINT " hundred dollars is acceptable. Loose change is not permitted. In the event"
PRINT " that you come closer to twenty-one than the dealer, you will have an amount"
PRINT " equal to your bet added to your bank. Likewise if you go over twenty-one, or"
PRINT " the dealer comes closer to twenty-one than you, or the dealer has blackjack"
PRINT " (a card with a value of ten plus an ace), then an amount equal to your bet is"
PRINT " subtracted from your bank. In the event of a push, a situation in which you"
PRINT " and the dealer end up with the same number of points, the dealer wins the"
PRINT " bet. In the event that you have a blackjack you will receive double your"
PRINT " bet. If either you or the dealer gets five cards and doesn't go over twenty-"
PRINT " one, a situation known as a 'Five Card Charlie', that player immediately wins"
PRINT " the bet for that hand. To help you get started your bank initially contains"
PRINT " one hundred dollars."
PRINT
COLOR 3,1
PRINT " -- Press left mouse button to continue --";
WHILE MOUSE(0)=0
WEND
WHILE MOUSE(0)<>0
WEND
COLOR 2,1
CLS
PRINT
PRINT " After you have placed your bet the Amiga deals the cards. You are able to"
PRINT " see both of your cards but not the dealer's down card. To 'take a hit' click"
PRINT " in the window containing the deck. If you are satisfied with your hand and"
PRINT " and want to stand then click in the window with the stop sign. After you"
PRINT " stand the Amiga takes its turn. It has no knowledge of the total of your"
PRINT " cards. It will look at the total of its cards and take a hit if that total"
PRINT " is sixteen or lower. After the Amiga completes its hand the winner is"
PRINT " declared and your bank total adjusted accordingly."
PRINT
PRINT " To start the next hand click again on the window containing the deck."
PRINT
PRINT " If you get irritated with the speech output or sound effects you may turn"
PRINT " either or both of them off in the 'Actions' menu. Also, if you get"
PRINT " disgusted with your bank total you can start over with one hundred dollars"
PRINT " by selecting 'Start Over' from the same menu."
PRINT
PRINT " When you have had your fill of blackjack and want to return to workbench or"
PRINT " CLI then select 'Quit' from the 'Actions' menu. If you quit with a negative"
PRINT " bank total you will be prompted for a credit card number (just kidding)."
PRINT " Enjoy."
PRINT
COLOR 3,1
PRINT " -- Press left mouse button to continue --";
WHILE MOUSE(0)=0
WEND
WHILE MOUSE(0)<>0
WEND
WINDOW CLOSE 3
RETURN
AreYouSure:
WINDOW 3," Warning!",(50,24)-(450,115),0
COLOR 1,3
CLS
LOCATE 2,5
PRINT "You are about to wipe out this game and";
LOCATE 3,5
PRINT Text$;
LOCATE 5,5
PRINT "Are you sure you want to do this?";
LINE (15,58)-(175,76),2,bf
LINE (203,58)-(385,76),2,bf
LINE (17,59)-(173,75),1,bf
LINE (205,59)-(383,75),1,bf
COLOR 2,1
LOCATE 9,5
PRINT "No -- Forget It!";
LOCATE 9,30
PRINT "Yeah -- Go Ahead";
WaitForAnswer:
IF MOUSE(0)=0 THEN WaitForAnswer
WHILE MOUSE(0)<>0
WEND
X=MOUSE(1)
Y=MOUSE(2)
IF Y>58 AND Y<76 THEN
IF X>15 AND X<175 THEN
Response$="NO"
WINDOW CLOSE 3
RETURN
ELSEIF X>203 AND X<385 THEN
Response$="YES"
WINDOW CLOSE 3
RETURN
END IF
END IF
GOTO WaitForAnswer
RETURN
InitializeMenu:
MENU 1,0,1," Actions "
MENU 1,1,1," Turn Speech Off "
MENU 1,2,1," Turn Sound Effects Off "
MENU 1,3,1," Start Over "
MENU 1,4,1," Quit "
MENU 2,0,1," Information "
MENU 2,1,1," How to Play "
MENU 2,2,1," About the Author "
MENU 3,0,1,""
MENU 4,0,1,""
RETURN
InitializeVariables:
SAY TRANSLATE$("")
Speech$="ON"
Sounds$="ON"
YourTotal&=100
BugZapper=1000
CardXLoc(1)=147
CardXLoc(2)=242
CardXLoc(3)=337
CardXLoc(4)=432
CardXLoc(5)=527
FOR I=0 TO 255
Timbre(I)=-128+(RND(1)*255)
NEXT I
WAVE 0,Timbre
WAVE 1,SIN
ERASE Timbre
VoiceParm(0)=90
VoiceParm(1)=1
VoiceParm(2)=170
VoiceParm(3)=0
VoiceParm(4)=20000
VoiceParm(5)=64
VoiceParm(6)=7
VoiceParm(7)=0
VoiceParm(8)=0
NextCard=0
FOR I=0 TO 3
FOR J=0 TO 12
Deck(I*13+J,0)=I
Deck(I*13+J,1)=J
NEXT J
NEXT I
NewHand:
YourCardCount=0
MyCardCount=0
YourHand1=0
YourHand2=0
MyHand1=0
MyHand2=0
Bet=0
RETURN
DealNewGame:
IF NextCard>=42 THEN GOSUB ShuffleDeck
CardX=CardXLoc(1)
CardY=13
Points=-(Deck(NextCard,1)+1)+15
GOSUB AddYourPoints
GOSUB DisplayCard
Points=-(Deck(NextCard,1)+1)+15
GOSUB AddYourPoints
CardX=CardXLoc(2)
GOSUB DisplayCard
YourCardCount=2
Points=-(Deck(NextCard,1)+1)+15
GOSUB AddMyPoints
DownCard0=Deck(NextCard,0)
DownCard1=Deck(NextCard,1)
XTarget=CardXLoc(1)
YTarget=92
OBJECT.X 1,17
OBJECT.Y 1,13
OBJECT.ON 1
FOR I=17 TO XTarget STEP 3
YDeal=((YTarget-13)/(XTarget-17))*(I-17)+13
OBJECT.X 1,I
OBJECT.Y 1,YDeal
NEXT I
OBJECT.OFF 1
PUT (CardXLoc(1),92),CardBack,PSET
IF Sounds$="ON" THEN GOSUB CardNoise
FOR I=1 TO BugZapper
NEXT I
NextCard=NextCard+1
Points=-(Deck(NextCard,1)+1)+15
GOSUB AddMyPoints
CardY=92
GOSUB DisplayCard
MyCardCount=2
GOSUB UpdateHandTotal
RETURN
CardNoise:
SOUND WAIT
SOUND 20,1,125,0
SOUND 90,1,125,1
SOUND RESUME
RETURN
AddYourPoints:
IF Points=14 THEN
YourHand1=YourHand1+1
YourHand2=YourHand2+11
IF YourHand2>21 THEN YourHand2=YourHand2-10
ELSEIF Points>10 THEN
YourHand1=YourHand1+10
YourHand2=YourHand2+10
ELSE
YourHand1=YourHand1+Points
YourHand2=YourHand2+Points
END IF
RETURN
AddMyPoints:
IF Points=14 THEN
MyHand1=MyHand1+1
MyHand2=MyHand2+11
IF MyHand2>21 THEN MyHand2=MyHand2-10
ELSEIF Points>10 THEN
MyHand1=MyHand1+10
MyHand2=MyHand2+10
ELSE
MyHand1=MyHand1+Points
MyHand2=MyHand2+Points
END IF
RETURN
EraseCardWindows:
LINE (138,13)-(623,70),0,bf
LINE (138,92)-(623,149),0,bf
RETURN
SetUpWindow:
LINE (0,0)-(640,200),2,bf
LINE (0,0)-(120,73),1,bf
LINE (5,2)-(115,71),0,bf
LINE (0,79)-(120,152),1,bf
LINE (5,81)-(115,150),0,bf
LINE (132,0)-(629,73),1,bf
LINE (137,2)-(624,71),0,bf
LINE (132,79)-(629,152),1,bf
LINE (137,81)-(624,150),0,bf
GOSUB GetTitles
WINDOW CLOSE 1
PUT (30,4),DeckTitle,PSET
PUT (341,4),YourTitle,PSET
PUT (350,83),MyTitle,PSET
PUT (41,83),StandTitle,PSET
ERASE DeckTitle,YourTitle,MyTitle,StandTitle
PUT (17,95),StopSign,PSET
ERASE StopSign
GOSUB MakeCardBack
RETURN
MessageSetUp:
LINE (0,158)-(629,186),1,bf
LINE (5,160)-(177,184),3,bf
LINE (183,158)-(193,186),2,bf
LINE (199,160)-(624,184),3,bf
COLOR 2,3
LOCATE 21,3
PRINT "Your Bank:";
LOCATE 22,3
PRINT "Current Wager:";
LOCATE 23,3
PRINT "Your Hand:";
GOSUB UpdateScore
GOSUB UpdateBet
GOSUB UpdateHandTotal
RETURN
UpdateScore:
COLOR 2,3
IF YourTotal&>=0 THEN
Text$="$"+MID$(STR$(YourTotal&),2)
ELSE
Text$="$"+STR$(YourTotal&)
END IF
Length=LEN(Text$)
LOCATE 21,13
PRINT " ";
LOCATE 21,22-Length
PRINT Text$;
RETURN
UpdateBet:
Text$="$"+MID$(STR$(Bet),2)
Length=LEN(Text$)
LOCATE 22,17
PRINT " ";
LOCATE 22,22-Length
PRINT Text$;
RETURN
UpdateHandTotal:
IF YourHand1<>YourHand2 AND YourHand2<22 THEN
Text$=STR$(YourHand1)+" or"+STR$(YourHand2)
ELSE
Text$=STR$(YourHand1)
END IF
Length=LEN(Text$)
LOCATE 23,14
PRINT " ";
LOCATE 23,22-Length
PRINT Text$;
RETURN
AnteUp:
Message$="Place your bet: $"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$(",,aannntteeee up sucker"),VoiceParm
INPUT "",Wager!
IF Wager!<1 THEN
Message$="I don't mess with change -- The minimum bid is $1"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$("Commme onn! We ain't playin for chicken feed here. The minimum bet is a dollar!"),VoiceParm
FOR I=1 TO 15000
NEXT I
GOTO AnteUp
ELSEIF Wager!>100 THEN
Message$="I'm not made of money -- The house limit is $100"
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$("Forget ittt. This ain't Montey Carlo. The howsse limmmit here is a hundred bucks"),VoiceParm
FOR I=1 TO 15000
NEXT I
GOTO AnteUp
ELSEIF Wager!-INT(Wager!)<>0 THEN
Message$="I don't like loose change. Use multiples of $1."
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$("I don't like loose change. Use multiples of a dollar."),VoiceParm
FOR I=1 TO 15000
NEXT I
GOTO AnteUp
END IF
Bet=Wager!
GOSUB UpdateBet
Message$=""
GOSUB PrintIt
RETURN
MessageWipe:
COLOR 2,3
LOCATE 22,26
PRINT " ";
RETURN
PrintIt:
GOSUB MessageWipe
Length=LEN(Message$)
LOCATE 22,52-Length\2
PRINT Message$;
RETURN
Logo:
PALETTE 3,0.7,0.1,0.1
WINDOW 2," Blackjack",(0,0)-(631,186),20
LOCATE 9,32
PRINT "AMIGA Blackjack";
LOCATE 11,38
PRINT "by";
LOCATE 13,34
PRINT "L. C. Teter";
SAY TRANSLATE$("Please stand by while I set things up"),VoiceParm
RETURN
MakeCardBack:
LINE (21,13)-(100,13),2
LINE (19,14)-(102,14),2
LINE (18,15)-(22,15),2 : LINE (99,15)-(103,15),2
LINE (17,16)-(21,64),2,bf
LINE (100,16)-(104,64),2,bf
LINE (18,65)-(22,65),2 : LINE (99,65)-(103,65),2
LINE (19,66)-(102,66),2
LINE (21,67)-(100,67),2
DIM Pat(3)
Pat(0)=&H9249
Pat(1)=&H4992
Pat(2)=&H9249
Pat(3)=&H4992
PATTERN ,Pat
PAINT (37,29),3,2
FOR I=0 TO 3
Pat(I)=&Hffff
NEXT I
PATTERN &Hffff,Pat
ERASE Pat
GET (17,13)-(104,67),CardBack
RETURN
GetTitles:
WINDOW OUTPUT 1
CLS
COLOR 1,0
LOCATE 1,1
PRINT "The Deck";
GET (0,0)-(63,7),DeckTitle
CLS
LOCATE 1,1
PRINT "Your Cards";
GET (0,0)-(79,7),YourTitle
CLS
LOCATE 1,1
PRINT "My Cards"
GET (0,0)-(63,7),MyTitle
CLS
LOCATE 1,1
PRINT "Stand"
GET (0,0)-(44,7),StandTitle
CLS
WINDOW OUTPUT 2
RETURN
BurnCard:
CardX=17
CardY=13
IF Deck(NextCard,1)=0 THEN Text$="an ace"
IF Deck(NextCard,1)=1 THEN Text$="a king"
IF Deck(NextCard,1)=2 THEN Text$="a queen"
IF Deck(NextCard,1)=3 THEN Text$="a jack"
IF Deck(NextCard,1)=4 THEN Text$="a ten"
IF Deck(NextCard,1)=5 THEN Text$="a nine"
IF Deck(NextCard,1)=6 THEN Text$="an eight"
IF Deck(NextCard,1)=7 THEN Text$="a seven"
IF Deck(NextCard,1)=8 THEN Text$="a six"
IF Deck(NextCard,1)=9 THEN Text$="a five"
IF Deck(NextCard,1)=10 THEN Text$="a four"
IF Deck(NextCard,1)=11 THEN Text$="a three"
IF Deck(NextCard,1)=12 THEN Text$="a deuce"
GOSUB DisplayBurnCard
Message$="Burning "+Text$
GOSUB PrintIt
IF Speech$="ON" THEN SAY TRANSLATE$(Message$),VoiceParm
FOR I=1 TO 8000
NEXT I
GOSUB MessageWipe
PUT (17,13),CardBack,PSET
IF Sounds$="ON" THEN GOSUB CardNoise
FOR I=1 TO BugZapper
NEXT I
RETURN
DisplayCard:
XTarget=CardX
YTarget=CardY
OBJECT.X 1,17
OBJECT.Y 1,13
OBJECT.ON 1
FOR I=17 TO XTarget STEP 5
YDeal=((YTarget-13)/(XTarget-17))*(I-17)+13
OBJECT.X 1,I
OBJECT.Y 1,YDeal
NEXT I
OBJECT.OFF 1
DisplayBurnCard:
PUT (CardX,CardY),card,PSET
PUT (CardX+26,CardY+16),BigSuit(0,Deck(NextCard,0)),PSET
PUT (CardX+5,CardY+12),LittleSuit(0,Deck(NextCard,0)),PSET
PUT (CardX+68,CardY+32),LittleSuit(0,Deck(NextCard,0)),PSET
PUT (CardX+8,CardY+3),Values(0,Deck(NextCard,1)),PSET
PUT (CardX+72,CardY+44),Values(0,Deck(NextCard,1)),PSET
IF Sounds$="ON" THEN GOSUB CardNoise
FOR I=1 TO BugZapper
NEXT I
NextCard=NextCard+1
RETURN
FlipDownCard:
CardX=CardXLoc(1)
CardY=92
PUT (CardX,CardY),card,PSET
PUT (CardX+26,CardY+16),BigSuit(0,DownCard0),PSET
PUT (CardX+5,CardY+12),LittleSuit(0,DownCard0),PSET
PUT (CardX+68,CardY+32),LittleSuit(0,DownCard0),PSET
PUT (CardX+8,CardY+3),Values(0,DownCard1),PSET
PUT (CardX+72,CardY+44),Values(0,DownCard1),PSET
IF Sounds$="ON" THEN GOSUB CardNoise
FOR I=1 TO BugZapper
NEXT I
RETURN
ShuffleDeck:
IF Pass<>1 THEN
LINE (17,13)-(104,67),0,bf
LOCATE 5,4
COLOR 1,0
PRINT "Shuffling"
END IF
FOR M=1 TO 3
FOR I=51 TO 0 STEP -1
J=INT(RND*I)+1
K=Deck(J,0)
L=Deck(J,1)
Deck(J,0)=Deck(I,0)
Deck(J,1)=Deck(I,1)
Deck(I,0)=K
Deck(I,1)=L
NEXT I
NEXT M
PUT (17,13),CardBack,PSET
NextCard=0
IF Pass<>1 THEN GOSUB BurnCard
RETURN
ReadGraphics:
OPEN "Card.Back" FOR INPUT AS 1
OBJECT.SHAPE 1,INPUT$(LOF(1),1)
CLOSE 1
FOR I=0 TO 662
READ card(I)
NEXT I
FOR I=0 TO 12
FOR J=0 TO 18
READ Values(J,I)
NEXT J
NEXT I
FOR I=0 TO 3
FOR J=0 TO 140
READ BigSuit(J,I)
NEXT J
NEXT I
FOR I=0 TO 3
FOR J=0 TO 24
READ LittleSuit(J,I)
NEXT J
NEXT I
FOR I=0 TO 662
READ StopSign(I)
NEXT I
'DELETE BeginDataCards-EndDataCards
RETURN
DATA 88,55,2,4095,-1,-1,-1,-1,-4096,16383,-1,-1,-1,-1,-1024,32767,-1,-1,-1
DATA -1,-512,-1,-1,-1,-1,-1,-256,-1,-1,-1,-1,-1,-256,-1,-1,-1,-1,-1,-256,-1
DATA -1,-1,-1,-1,-256,-1,-1,-1,-1,-1,-256,-1,-1,-1,-1,-1,-256,-1,-1,-1,-1,-1
DATA -256,-1,-1,-1,-1,-1,-256,-1,-1,-1,-1,-1,-256,-1,-1,-1,-1,-1,-256,-1
DATA -256,0,0,-1,-256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256,-1,-193,-1
DATA -4,-1,-256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1
DATA -256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256
DATA -1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256,-1
DATA -193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256,-1,-193
DATA -1,-4,-1,-256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4
DATA -1,-256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1
DATA -256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256
DATA -1,-193,-1,-4,-1,-256,-1,-193,-1,-4,-1,-256,-1,-256,0,0,-1,-256,-1,-1
DATA -1,-1,-1,-256,-1,-1,-1,-1,-1,-256,-1,-1,-1,-1,-1,-256,-1,-1,-1,-1,-1
DATA -256,-1,-1,-1,-1,-1,-256,-1,-1,-1,-1,-1,-256,-1,-1,-1,-1,-1,-256,-1,-1
DATA -1,-1,-1,-256,-1,-1,-1,-1,-1,-256,-1,-1,-1,-1,-1,-256,32767,-1,-1,-1,-1
DATA -512,16383,-1,-1,-1,-1,-1024,4095,-1,-1,-1,-1,-4096,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255
DATA -1,-1,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192
DATA 0,3,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0
DATA 3,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3
DATA 0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3,0
DATA 0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3,0,0,0,192,0,3,0,0
DATA 0,192,0,3,0,0,0,192,0,3,0,0,0,255,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,2,-6400
DATA -15616,-15616,-26368,-32512,15360,15360,-256,6144,15360,15360,26112
DATA 32256,-15616,-15616,0,8,8,2,6400,-26368,-27904,-30976,-27904,-26368
DATA 6400,-256,-6656,26112,27648,30720,27648,26112,-6656,0,8,8,2,-14592
DATA -27904,14592,14592,14592,-27904,-15616,-1792,14336,27648,-14848,-14848
DATA -14848,27648,15360,1536,8,8,2,-3840,-1792,-1792,-1792,-26368,-26368
DATA -15616,-256,3584,1536,1536,1536,26112,26112,15360,0,8,8,2,-32512,-23296
DATA -6400,-6400,-6400,-6400,-15616,-256,32256,23040,6144,6144,6144,6144
DATA 15360,0,8,8,2,-15616,-26368,-26368,-16128,-1792,-3328,-14592,-256,15360
DATA 26112,26112,15872,1536,3072,14336,0,8,8,2,-15616,-26368,-26368,-15616
DATA -26368,-26368,-15616,-256,15360,26112,26112,15360,26112,26112,15360,0,8
DATA 8,2,-32512,-26368,-1792,-3328,-6400,-6400,-6400,-256,32256,26112,1536
DATA 3072,6144,6144,6144,0,8,8,2,-7424,-12544,-24832,-32000,-26368,-26368
DATA -15616,-256,7168,12288,24576,31744,26112,26112,15360,0,8,8,2,-32512
DATA -24832,-32000,-1792,-1792,-26368,-15616,-256,32256,24576,31744,1536
DATA 1536,26112,15360,0,8,8,2,-7424,-15616,-27904,13056,256,-3328,-7936,-256
DATA 7168,15360,27648,-13312,-512,3072,7680,0,8,8,2,-15616,-26368,-1792
DATA -7424,-1792,-26368,-15616,-256,15360,26112,1536,7168,1536,26112,15360,0
DATA 8,8,2,-15616,-26368,-1792,-7424,-12544,-26368,-32512,-256,15360,26112
DATA 1536,7168,12288,26112,32256,0,36,23,2,-1,-1,-4096,-1,-1,-4096,-1,-1
DATA -4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1
DATA -4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1
DATA -4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1
DATA -4096,-1,-1,-4096,-1,-1,-4096,252,504,0,1023,2046,0,4095,-28673,-32768
DATA 4095,-8193,-32768,8191,-1,-16384,8191,-1,-16384,8191,-1,-16384,8191,-1
DATA -16384,4095,-1,-32768,4095,-1,-32768,2047,-1,0,1023,-2,0,511,-4,0,255
DATA -8,0,127,-16,0,63,-32,0,31,-64,0,15,-128,0,7,-256,0,3,-512,0,1,-1024,0
DATA 0,-2048,0,0,28672,0,36,23,2,-1,-16385,-4096,-1,8191,-4096,-2,4095,-4096
DATA -4,2047,-4096,-16,511,-4096,-32,255,-4096,-64,127,-4096,-128,63,-4096
DATA -512,15,-4096,-1024,7,-4096,-2048,3,-4096,-4096,1,-4096,-8192,0,-4096
DATA -16384,0,28672,-16384,0,28672,-16384,0,28672,-8192,0,-4096,-2048,3
DATA -4096,-510,2063,-4096,-2,4095,-4096,-2,4095,-4096,-4,2047,-4096,-8,1023
DATA -4096,0,16384,0,0,-8192,0,1,-4096,0,3,-2048,0,15,-512,0,31,-256,0,63
DATA -128,0,127,-64,0,511,-16,0,1023,-8,0,2047,-4,0,4095,-2,0,8191,-1,0
DATA 16383,-1,-32768,16383,-1,-32768,16383,-1,-32768,8191,-1,0,2047,-4,0,509
DATA -2064,0,1,-4096,0,1,-4096,0,3,-2048,0,7,-1024,0,36,23,2,-1,-1,-4096,-1
DATA -1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1
DATA -1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1
DATA -1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,-1
DATA -1,-4096,-1,-1,-4096,-1,-1,-4096,-1,-1,-4096,0,8192,0,0,28672,0,1,-2048
DATA 0,3,-512,0,7,-256,0,31,-128,0,63,-64,0,127,-32,0,255,-8,0,1023,-4,0
DATA 2047,-2,0,4095,-1,0,2047,-2,0,1023,-4,0,255,-8,0,127,-32,0,63,-64,0,15
DATA -128,0,7,-256,0,3,-512,0,1,-2048,0,0,28672,0,0,8192,0,36,23,2,-2,4095
DATA -4096,-16,511,-4096,-32,255,-4096,-64,127,-4096,-128,63,-4096,-128,63
DATA -4096,-128,63,-4096,-64,127,-4096,-32,255,-4096,-16,511,-4096,-8,1023
DATA -4096,-512,15,-4096,-2048,3,-4096,-4096,1,-4096,-4096,1,-4096,-4096,1
DATA -4096,-2048,3,-4096,-512,15,-4096,-126,2111,-4096,-2,4095,-4096,-2,4095
DATA -4096,-4,2047,-4096,-8,1023,-4096,1,-4096,0,15,-512,0,31,-256,0,63,-128
DATA 0,127,-64,0,127,-64,0,127,-64,0,63,-128,0,31,-256,0,15,-512,0,7,-1024,0
DATA 511,-16,0,2047,-4,0,4095,-2,0,4095,-2,0,4095,-2,0,2047,-4,0,511,-16,0
DATA 125,-2112,0,1,-4096,0,1,-4096,0,3,-2048,0,7,-1024,0,15,11,2,-2,-2,-2,-2
DATA -2,-2,-2,-2,-2,-2,-2,15480,32508,-2,-2,32764,16376,8176,4064,1984,896
DATA 256,15,11,2,-898,-1986,-4066,-8178,-16378,-32766,0,0,-31678,-898,-1986
DATA 896,1984,4064,8176,16376,32764,-2,-2,31676,896,1984,15,11,2,-2,-2,-2,-2
DATA -2,-2,-2,-2,-2,-2,-2,896,1984,4064,8176,32764,-2,32764,8176,4064,1984
DATA 896,15,11,2,-1986,-8178,-16378,-8178,-1986,-32766,0,0,-31678,-898,-1986
DATA 1984,8176,16376,8176,1984,32764,-2,-2,31676,896,1984
DATA 88,55,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,-1,-8,0,0
DATA 0,63,-1,-2,0,0,0,255,-1,-1,-32768,0,0,1023,-1,-1,-8192,0,0,4095,-1,-1
DATA -2048,0,0,16383,-1,-1,-512,0,0,-1,-1,-1,-128,0,3,-1,-1,-1,-32,0,15,-1
DATA -1,-1,-8,0,31,-1,-1,-1,-4,0,31,-1,-1,-1,-4,0,31,-1,-1,-1,-4,0,31,-1,-1
DATA -1,-4,0,31,-1,-1,-1,-4,0,31,-1,-1,-1,-4,0,31,-1,-1,-1,-4,0,31,-1,-1,-1
DATA -4,0,31,-1,-1,-1,-4,0,31,-1,-1,-1,-4,0,31,-1,-1,-1,-4,0,15,-1,-1,-1,-8
DATA 0,3,-1,-1,-1,-32,0,0,-1,-1,-1,-128,0,0,16383,-1,-1,-512,0,0,4095,-1,-1
DATA -2048,0,0,1023,-1,-1,-8192,0,0,255,-1,-1,-32768,0,0,63,-1,-2,0,0,0,15
DATA -1,-8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,63,-1,-2,0,0,0,255,-1,-1,-32768,0,0,1023,-1,-1
DATA -8192,0,0,4095,-1,-1,-2048,0,0,16383,-1,-1,-512,0,0,32767,-1,-1,-256,0
DATA 1,-1,-1,-1,-64,0,7,-1,-1,-1,-16,0,31,-1,-1,-1,-4,0,127,-1,-1,-1,-1,0
DATA 255,-1,-1,-1,-1,-32768,255,-1,-1,-1,-1,-32768,255,-16,-8079,-16135,-1
DATA -32768,255,-26,26980,-6544,-1,-32768,255,-29,-1586,26224,-1,-32768,255
DATA -15,-1586,24825,-1,-32768,255,-4,31182,26617,-1,-32768,255,-26,31204
DATA -6145,-1,-32768,255,-16,-3855,-15367,-1,-32768,255,-1,-1,-1,-1,-32768
DATA 255,-1,-1,-1,-1,-32768,127,-1,-1,-1,-1,0,31,-1,-1,-1,-4,0,7,-1,-1,-1
DATA -16,0,1,-1,-1,-1,-64,0,0,32767,-1,-1,-256,0,0,16383,-1,-1,-512,0,0,4095
DATA -1,-1,-2048,0,0,1023,-1,-1,-8192,0,0,255,-1,-1,-32768,0,0,63,-1,-2,0,0
DATA 0,0,127,0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0
DATA 0,127,0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,0
DATA 127,0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,255,-1,-1,-32768
DATA 0,0,255,-1,-1,-32768,0,0,255,-1,-1,-32768,0,0,255,-1,-1,-32768,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0